import sys

class Solution:
    def findMinArrowShots(self, points: List[List[int]]) -> int:
        if len(points)==0:
            return 0
        points=sorted(points,key=lambda x:x[0])
        stack=[]
        tail=sys.maxsize
        count=0
        for i in points:
            if i[0]<=tail:
                tail=min([i[1],tail])
            else:
                count+=1
                tail=i[1]
        return count+1